"""添加客户页面"""
from selenium.common import NoSuchElementException
from selenium.webdriver.common.by import By

from page.base_page import BasePage


class AddCustomerPage(BasePage):
    url="/index.php?m=customer&a=add"
    #定位器
    success_text=(By.CSS_SELECTOR,"body > div.container > div.page-header > h4")
    def successes_text(self):
        #成功进入添加客户的成功信息
        try:
            text=self.find_element(self.success_text).text
        except NoSuchElementException:
            text=""
        return text

